package 滴滴出行;

import java.util.Arrays;
import java.util.Scanner;

public class 第二题找出第K大的数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine().trim();
            String[] sa = s.split("\\s+");
            int[] a = new int[sa.length];
            for (int i = 0; i < a.length; i++) {
                a[i] = Integer.parseInt(sa[i]);
            }
            int k = Integer.parseInt(sc.nextLine().trim());
            func(a, k);
        }
        sc.close();
    }

    private static void func(int[] a, int k) {
        Arrays.sort(a);
        System.out.println(a[a.length - k]);
    }
}
